:root {
  --text-color: #081E3D;
  --text-color-1: rgba(16, 33, 55, 0.75);
  --active-border-color: #13325eca;
  --active-color: #13325eba;
  --black-shadow-color: rgba(191, 202, 219, .8);
  --white-shadow-color: rgba(255, 255, 255, .8);
  --blackShadow: 3px 3px 6px rgba(191, 202, 219, .8);
  --whiteShadow: -3px -3px 6px rgba(255, 255, 255, .8);
  --bg-color: #E7EAF3;
  --success-color: #529E4E;
  --error-color: #BA4848;
}

* {
  padding: 0;
  margin: 0;
  user-select: none;
}

html,
body,
#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

@mixin grass($offset: 3px, $width: 6px) {
  box-shadow: -1 * $offset -1 * $offset $width var(--white-shadow-color), $offset $offset $width var(--black-shadow-color);
}

@mixin grass-inset($offset: 3px, $width: 6px) {
  box-shadow: inset -1 * $offset -1 * $offset $width var(--white-shadow-color), inset $offset $offset $width var(--black-shadow-color);
}

#app,
body {
  .success {
    color: var(--success-color);
  }

  .error {
    color: var(--error-color);
  }

  .icon {
    cursor: pointer;
  }

  .db-drawer {
    background-color: var(--bg-color);
    
    .db-drawer__body {
      overflow-y: auto;
    }
  }

  .db-switch {
    .db-switch__core {
      @include grass(2px, 4px);
    }

    &.is-checked {
      .db-switch__core {
        background-color: var(--active-color);
        border-color: transparent;
      }
    }

    .db-switch__label {
      color: var(--black-shadow-color);

      &.is-active {
        color: #606266;
      }
    }
  }

  .db-input {
    &.text-input {
      .db-input__inner {
        @include grass-inset();
      }
    }

    .db-input__inner {
      @include grass();
      background-color: var(--bg-color);
      color: var(--text-color-1);
      border: none;
    }

    &.is-active .db-input__inner,
    .db-input__inner:focus {
      border-color: var(--text-color);
    }

    .db-input-group__append, .db-input-group__prepend {
      @include grass();
      border: none;
      background-color: var(--bg-color);
    }
  }

  .db-dialog {
    background-color: var(--bg-color);

    .db-dialog__title {
      color: var(--text-color);
    }
  }

  .db-radio {
    margin-right: 5px;

    .db-radio__label {
      padding-left: 5px;
    }

    .db-radio__input.is-checked {
      .db-radio__inner {
        background: var(--active-color);
        border-color: var(--text-color);
        border: none;
      }
      
      +.db-radio__label {
        color: var(--text-color);
      }
    }
  }

  .grass {
    @include grass();
  }

  .grass-inset {
    @include grass-inset();
  }

  .db-popover {
    color: inherit;
    background: var(--bg-color);
  }

  .db-popper[data-popper-placement^=top] .popper__arrow {
    border-top-color: var(--bg-color) !important;

    &::after {
      border-top-color: var(--bg-color) !important;
    }
  }

  .db-popper[data-popper-placement^=bottom] .popper__arrow {
    border-bottom-color: var(--bg-color) !important;

    &::after {
      border-bottom-color: var(--bg-color) !important;
    }
  }

  .db-popper[data-popper-placement^=left] .popper__arrow {
    border-left-color: var(--bg-color) !important;

    &::after {
      border-left-color: var(--bg-color) !important;
    }
  }

  .db-popper[data-popper-placement^=right] .popper__arrow {
    border-right-color: var(--bg-color) !important;

    &::after {
      border-right-color: var(--bg-color) !important;
    }
  }

  .db-collapse {
    border: none;
  }

  .db-collapse-item {
    .db-collapse-item__header {
      color: inherit;
      font-weight: bold;
      border: none;
      background-color: transparent;

      .button {
        padding: 4px 10px;
        margin-left: 10px;
        border-radius: 4px;
      }
    }

    .db-collapse-item__wrap {
      border: none;
      background-color: transparent;
    }
  }

  .input,
  .input:focus {
    @include grass-inset();
    background-color: transparent;
    background-image: none;
    border-radius: 4px;
    border: none;
    box-sizing: border-box;
    display: inline-block;
    font-size: inherit;
    height: 28px;
    width: 92px;
    outline: none;
    padding: 0 4px;
    text-align: center;
  }

  .button {
    @include grass();
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    margin-left: 10px;
    box-sizing: border-box;
  
    &:hover {
      @include grass-inset();
    }
  
    &:active {
      @include grass();
    }
  
    &:first-child {
      margin-left: 0px;
    }
  }

  .db-dropdown-menu {
    background-color: var(--bg-color);
    border: none;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;

    .db-dropdown-menu__item:focus,
    .db-dropdown-menu__item:not(.is-disabled):hover {
      font-weight: bold;
      color: var(--active-color);
      background-color: transparent;
      box-sizing: border-box;
    }
  }

  a {
    color: var(--text-color);
    text-decoration: none;
  }
}

.normal-input {
  @include grass();
  background-color: transparent;
  background-image: none;
  border: none;
  box-sizing: border-box;
  display: inline-block;
  font-size: inherit;
  outline: none;
  padding: 0 15px;
  height: 40px;
  line-height: 40px;
  border-radius: 4px;
  width: 100%;

  &[type='file'] {
    background: unset;
    border-color: inherit;
    border-width: 0;
    border-radius: 4px;
    padding: 0;
    font-size: unset;
    line-height: 40px;
    cursor: pointer;

    &:focus {
      outline: none;
    }
  }
}
